//
//  FirstViewController.m
//  Ui01
//
//  Created by gzjd on 2017/5/13.
//  Copyright © 2017年 gzjd. All rights reserved.
//

#import "FirstViewController.h"

@interface FirstViewController ()

@end

@implementation FirstViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor whiteColor];
   /*////////////////////////////
    UILabel *label=[[UILabel alloc]initWithFrame:CGRectMake(20, 100,260, 150)];
    label.backgroundColor=[UIColor redColor];
    [self.view addSubview:label];
    //label.alpha=0.1;
    label.text=@"这是一段话这是一段话这是一段话这是一段话这是一段话这是一段话这是一段话这是一段话这是一段话";
    //居中
    label.textAlignment=NSTextAlignmentCenter;
    label.textColor=[UIColor whiteColor];
   // label.font=[UIFont systemFontOfSize:30];
    label.font=[UIFont boldSystemFontOfSize:30];
    label.shadowColor=[UIColor yellowColor];
    label.shadowOffset=CGSizeMake(2, 2);
    label.layer.cornerRadius=10;
    label.layer.masksToBounds=YES;
    label.numberOfLines=3;
    
   // label.font=[UIFont fontWithName:@"隶书" size:30];
    
    */////////
    
    
    //初始化
    /*/////////////////////////
     UIView *view1=[[UIView alloc]initWithFrame:CGRectMake(370, 100, 100, 100)];
    //设置背景色
    view1.backgroundColor=[UIColor blueColor];
    UIView *view2=[[UIView alloc] initWithFrame:CGRectMake(200, 300, 100, 100)];
    view2.backgroundColor=[UIColor orangeColor];
    [self.view addSubview:view1];
    [self.view addSubview:view2];
    //view1.alpha=0.5;
    view1.hidden=NO;
    view1.center=self.view.center;
    view1.tag=99;
    UIView *resultView=[self.view viewWithTag:99];
    resultView.backgroundColor=[UIColor redColor];
    [self.view bringSubviewToFront:resultView];
    [self.view sendSubviewToBack:resultView];
    [resultView removeFromSuperview];
     */////////////////////
    
    ///////////
    UIButton *button=[UIButton buttonWithType:UIButtonTypeCustom];
    button.backgroundColor=[UIColor blueColor];
    [self.view addSubview:button];
    button.frame=CGRectMake(10, 100, 160, 40);
    [button setTitle:@"淘宝" forState:UIControlStateNormal];
//    [button setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
//    UIImage *imgage=[UIImage imageNamed:@"taobao.jpg"];
//    [button setBackgroundImage:imgage forState:UIControlStateNormal];
    //[button setImage:imgage forState:<#(UIControlState)#>]
    [button setImage:[UIImage imageNamed:@"taobao.jpg"] forState:UIControlStateNormal];
    [button setImageEdgeInsets:UIEdgeInsetsMake(5, 10, 5, 80)];
    [button setTitleEdgeInsets:UIEdgeInsetsMake(0, 50, 0, 0)];
    [button addTarget:self action:@selector(youTouchMe) forControlEvents:UIControlEventTouchUpInside];
    
    //添加
   
   
    
    NSLog(@"%@",self.view);
    // Do any additional setup after loading the view.
}
-(void )youTouchMe{
    NSLog(@"你莫了我。。。。");
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
